package com.acargil.sudoku;


import com.acargil.sudoku.model.BaseSudokuEngineImpl;
import com.acargil.sudoku.model.ISudokuEngine;
import com.acargil.sudoku.view.Frame;
import com.acargil.sudoku.view.ISudokuView;
import com.acargil.sudoku.view.listeners.AboutListener;
import com.acargil.sudoku.view.listeners.ClearListener;
import com.acargil.sudoku.view.listeners.ExitListener;
import com.acargil.sudoku.view.listeners.GenerateListener;
import com.acargil.sudoku.view.listeners.InputListener;
import com.acargil.sudoku.view.listeners.LoadListener;
import com.acargil.sudoku.view.listeners.SaveListener;
import com.acargil.sudoku.view.listeners.SelectionListener;

/**
 *
 * @author Oguzhan
 */
public class Init {

    public static void main(String[] args) {
    	javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
            	ISudokuView view = new Frame();
            	ISudokuEngine engine = new BaseSudokuEngineImpl();
            	view.addAboutListener(AboutListener.getInstance());
            	view.addClearListener(ClearListener.getInstance(engine, view));
            	view.addExitListener(ExitListener.getInstance(engine, view));
            	view.addGenerateListener(GenerateListener.getInstance(engine, view));
            	view.addInputListener(InputListener.getInstance(view, engine));
            	view.addLoadListener(LoadListener.getInstance(view, engine));
            	view.addSaveListener(SaveListener.getInstance(engine, view));
            	view.addSelectionListener(SelectionListener.getInstance(view));
            }
        });
    }
    
}
